﻿using Domain.Entities;
using FluentMigrator;
using FrameworkCore.Extensions;

namespace AiBLSmartEdu.Module.SmartEnglish.API.Migrations;

[Migration(202409191041)]
public class VocabularyAddColumn : ForwardOnlyMigration
{
    public override void Up()
    {
        Alter.Table(MigrationExpressions.GetTableName(typeof(Vocabulary)))
          .AddColumn(MigrationExpressions.ColumnNameFor<Vocabulary>(nameof(Vocabulary.Word))).AsString(int.MaxValue).Nullable().WithColumnDescription("单词")
          .AddColumn(MigrationExpressions.ColumnNameFor<Vocabulary>(nameof(Vocabulary.Description))).AsString(int.MaxValue).Nullable().WithColumnDescription("单词描述")
          .AddColumn(MigrationExpressions.ColumnNameFor<Vocabulary>(nameof(Vocabulary.IsFavorited))).AsBoolean().Nullable().WithDefaultValue(true).WithColumnDescription("是否收藏")
          .AddColumn(MigrationExpressions.ColumnNameFor<Vocabulary>(nameof(Vocabulary.LearningStatus))).AsInt32().Nullable().WithColumnDescription("单词学习状态");
    }
}
